// Fill out your copyright notice in the Description page of Project Settings.

#include "WorldRoadObject.h"
#include "WorldEntityReferencing.h"

WORLD_ENTITY_META_DEFINE(FWorldRoadObject, FWorldEntity);

FWorldRoadObject::FWorldRoadObject()
	: Super()
	, Type(this, "")
	, Name(this, "")
	, S(this, 0.0)
	, T(this, 0.0)
	, ZOffset(this, 0.0)
	, ValidLength(this, 0.0)
	, Orientation(this, FWorldRoadObjectOrientation::None)
	, Length(this, 0.0)
	, Width(this, 0.0)
	, Radius(this, 0.0)
	, Height(this, 0.0)
	, Hdg(this, 0.0)
	, Pitch(this, 0.0)
	, Roll(this, 0.0)
	, Repeat(this)
	, Outline(this)
	, Material(this)
	, Validity(this)
	, ParkingSpace(this)
{}

FWorldRoadObject::FWorldRoadObject(const json& j)
	: Super(j)
	, Type(this, "", _xml, "type")
	, Name(this, "", _xml, "name")
	, S(this, 0.0, _xml, "s")
	, T(this, 0.0, _xml, "t")
	, ZOffset(this, 0.0, _xml, "zOffset")
	, ValidLength(this, 0.0, _xml, "validLength")
	, Orientation(this, FWorldRoadObjectOrientation::None, _xml, "orientation")
	, Length(this, 0.0, _xml, "length")
	, Width(this, 0.0, _xml, "width")
	, Radius(this, 0.0, _xml, "radius")
	, Height(this, 0.0, _xml, "height")
	, Hdg(this, 0.0, _xml, "hdg")
	, Pitch(this, 0.0, _xml, "pitch")
	, Roll(this, 0.0, _xml, "roll")
	, Repeat(this, _xml, "repeat")
	, Outline(this, _xml, "outline")
	, Material(this, _xml, "material")
	, Validity(this, _xml, "validity")
	, ParkingSpace(this, _xml, "parkingSpace")
{}

FWorldRoadObject::~FWorldRoadObject()
{}

void FWorldRoadObject::Resolve(FWorldEntityReferencing& referencing)
{
	Super::Resolve(referencing);
	referencing
		.Resolve(Repeat)
		.Resolve(Outline)
		.Resolve(Material)
		.Resolve(Validity)
		.Resolve(ParkingSpace);
}
